{{ $defaultLogo := $.Site.Params.Images.defaultLogo }}
{{ $logosPath := $.Site.Params.Images.logosPath }}

{{ range $index, $element := $.Site.Data.navsites }}
    {{ $hash_str := printf "%v-main-%v" $index .taxonomy | md5 }}
    {{/*  一级分类  */}}
    {{ partial "main/component/top.html" (dict "ctx" $element "hash" $hash_str ) }}

    {{ with .list }}
        {{ if gt (len .) 0 }}
            {{ range $idx, $_ := . }}
            {{ $hash_str_sub := printf "%v-%v-child-%v" $index $idx .term | md5 }}
            {{/*  二级分类  */}}
            <div class="d-flex flex-fill flex-tab align-items-center">
                <div class="overflow-x-auto slider_menu mini_tab" slidertab="sliderTab">
                    <ul class="nav nav-pills menu" role="tablist">
                        <li class="pagenumber nav-item" more='0'>
                            <a id="category-{{ $hash_str_sub }}" 
                                class="nav-link" 
                                data-toggle="pill-none" 
                                href="javascript: void(0);">{{ .term }}</a>
                        </li>
                    </ul>
                </div>
                <div class='flex-fill'></div>
            </div>

            <div class="tab-content mt-2">
                <div id="tab-{{ $hash_str_sub }}" class="tab-pane active" load="1">
                    <div id="{{ $hash_str_sub }}" class="row sortable row-{{ $hash_str_sub }}">
                        {{ range $i, $e := .links }}
                        {{ $index_id := printf "index-%v-%v-%v" $index $idx $i }}
                        {{ partial "main/component/grid.html" (dict "ctx" $e "hash" $hash_str_sub 
                            "index" $index_id 
                            "defaultLogo" $defaultLogo
                            "logosPath" $logosPath
                            ) }}
                        {{ end }}
                    </div>                    
                </div>
            </div>
            {{ end }}
        {{ end }}
    {{ end }}
{{ end }}